#include "addperson.h"
#include "ui_addperson.h"

AddPerson::AddPerson(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AddPerson)
{
    ui->setupUi(this);
    connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(onBtnClicked()));
}

AddPerson::~AddPerson()
{
    delete ui;
}

QString AddPerson::name() const
{
    return mName;
}

void AddPerson::onBtnClicked()
{
    if(!ui->lineEdit->text().isEmpty()){
        mName=ui->lineEdit->text();
        accept();
    }
}
